using System;
using System.Collections.Generic;
using System.Text;
using LuaInterface;
using SharpWind.Resources.Creators;
using SharpWind.Tools;

namespace SharpWind.Resources.Managers
{
	public class ScriptManager : ResourceManager<Script>
	{
		private Lua lua = null;
		
		internal ScriptManager()
		{
			this.lua = new Lua();
		}
	
		public Script Load( string name )
		{
			ScriptFromFileCreator creator = new ScriptFromFileCreator( Directories.Scripts + name );
			return this.Create( name, creator );
		}
	
		protected override void OnDeviceLost( object sender, EventArgs e )
		{
			
		}

		protected override void OnDeviceReset( object sender, EventArgs e )
		{
			
		}
	
		internal Lua Lua
		{
			get
			{
				return this.lua;
			}
		}

		public override Script this[string name]
		{
			get
			{
				return Load( name );
			}
		}
	}
}
